
			
			<div class="clear"></div> <!-- End .clear -->
			
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>Content box</h3>
					
					<ul class="content-box-tabs"><!-- href must be unique and match the id of target div -->
						<li><a href="#tab2" class="default-tab">Forms</a></li>
					</ul>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
					<div class="tab-content default-tab" id="tab2">
					
						<form action="" method="post" enctype="multipart/form-data" id="admin_ins">
							
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								
								<p>
									<label>账号</label>
										<input class="text-input small-input" type="text" id="username" name="ueername" disabled="disabled" value="<?php echo $upd_data['username'];?>" /> <!-- Classes for input-notification: success, error, information, attention -->
										<br /><small id="musername">账号不可更改</small>
								</p>
								
								<p>
									<label>昵称</label>
										<input class="text-input small-input" type="text" id="nicheng" name="nicheng"  value="<?php echo $upd_data['nicheng'];?>" /> 
										<br /><small id="mnicheng">昵称不可重复</small>
								</p>

								<p>
									<label>性别</label>
									<input type="radio" name="sex" value="1" checked="checked" disabled="disabled"> 男
									<input type="radio" name="sex" value="0" disabled="disabled"> 女
								</p>

								<p>
									<label>密码</label>
										<input class="text-input small-input" type="password" id="password"  /> <!-- Classes for input-notification: success, error, information, attention -->
										<br /><small id="mpassword"></small>
								</p>

								<p>
									<label>确认密码</label>
										<input class="text-input small-input" type="password" id="passworda" name="passworda" /> <!-- Classes for input-notification: success, error, information, attention -->
										<br /><small id="mpassworda"></small>
								</p>



								<p>
									<label>手机号码</label>
										<input class="text-input small-input" type="text" id="phone" name="phone" value="<?php echo $upd_data['phone'];?>"/> <!-- Classes for input-notification: success, error, information, attention -->
										<br /><small id="mphone"></small>
								</p>

								<p>
									<label>邮箱号码</label>
										<input class="text-input small-input" type="text" id="email" name="email" value="<?php echo $upd_data['email'];?>"/> <!-- Classes for input-notification: success, error, information, attention -->
										<br /><small id="memail"></small>
								</p>
								
								
								
								
								
								
								<p>
									<label>权限角色</label>              
									<select name="permission" id="permission" class="small-input " >
										<option value="0">无角色</option>

										<?php foreach($permission as $perm):?>
										<option value="<?php echo $perm['id'];?>" <?php if($upd_per['id']==$perm['id']){echo 'selected="selected"';}?> ><?php echo $perm['per_name'];?></option>
										<?php endforeach ; ?>
									</select> 
								</p>

								<p id="waterCon">  </p><!--空的P标签用于当水印类别是图片或文字时显示相对饮的控件-->

								<p>
									<label>状态</label>              
									<select name="status" id="status" >
										<option value="0" <?php if($upd_data['status']==0){echo 'selected="selected"';}?> >冻结</option>
										<option value="1" <?php if($upd_data['status']==1){echo 'selected="selected"';}?> >正常</option>
									</select> 
								</p>
								
								
								
							
								
								<p>
									<input class="button" type="submit" value="提交" />
									<small id="msub"></small>
								</p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
						
					</div> <!-- End #tab2 -->        
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			
			<script type="text/javascript">

				//用户名无刷新验证
				

				//昵称验证
				$("#nicheng").blur(function(){
					var nicheng = $("#nicheng").val();

					$.ajax({
						url : '',

						type : 'post',

						data : { bnicheng : nicheng },

						dataType : 'json',

						success : function(msg){


							if(nicheng == ''){

								$("#mnicheng").text('昵称无修改').css('color','green');

							}else if(msg==1){

								$("#mnicheng").text('昵称已经存在').css('color','red');
								return false;

							}else{

								$("#mnicheng").text('昵称可用').css('color','green');
								

							}

						}
					})

						return false;
					// alert(username);
				})

				//密码密码  : BUG:有个下拉框 选择后昵称若为空会被填上 ,缺少正则表达式
				$("#password").blur(function(){
					var password = $("#password").val();

					$.ajax({
						url : '',

						type : 'post',

						data : { bpassword : password },

						dataType : 'json',

						success : function(msg){


							if(password == ''){

								$("#mpassword").text('').css('color','green');

							}else if(msg==1){

								$("#mpassword").text('密码格式正确').css('color','green');

							}else{

								$("#mpassword").text('密码格式错误').css('color','red');
								return false;

							}

						}
					})

					// if(password==''){

					// 	$("#mpassword").text('').css('color','green');

					// }else{
					// 	$("#mpassword").text('密码格式正确').css('color','green');
					// }

					
					return false;
					// alert(username);
				})

				$("#passworda").blur(function(){
					var passworda = $("#passworda").val();

					var password = $("#password").val();

					if(passworda==''){

						$("#mpassworda").text('').css('color','green');

						return false;
					}else if(passworda!=password){
						$("#mpassworda").text('两次密码不一致').css('color','red');

						return false;
					}else{
						$("#mpassworda").text('该密码可用').css('color','green');
					}

					
					return false;
					// alert(username);
				})

				//手机号码格式、唯一新验证
				$("#phone").blur(function(){
					var phone = $("#phone").val();

					// if(phone){

						

					// 	return false;
					// }

					$.ajax({
						url:'',

						type: 'post',

						data:{phone:phone},

						dataType:'json',

						success : function(msg){


							if(phone==''){

								$("#mphone").text('').css('color','green');

							}else if(msg.puniqueness == 1){

								$("#mphone").text('手机号已存在').css('color','red');

							}else if(msg.prule == 1){

								$("#mphone").text('手机格式正确').css('color','green');
								
							}else{

								$("#mphone").text('手机格式错误').css('color','red');

								return false;
							}

							
						}


					})
					return false;
					// alert(username);
				})

				$("#email").blur(function(){
					var email = $("#email").val();

					

					$.ajax({
						url:'',

						type: 'post',

						data:{email:email},

						dataType:'json',

						success : function(msg){


							if(email==''){

								$("#memail").text('').css('color','green');
								
							}else if(msg.euniqueness == 1){

								$("#memail").text('邮箱号已存在').css('color','red');

								return false;

							}else if(msg.erule == 1){

								$("#memail").text('邮箱格式正确').css('color','green');
								
							}else {

								$("#memail").text('邮箱格式错误').css('color','red');

								return false;
							}
						}


					})
					return false;
					// alert(username);
				})

				$("#admin_ins").submit(function(){
					var password = $("#password").val();
					var phone = $("#phone").val();
					var email = $("#email").val();
					var permission = $("#permission").val();
					var status = $("#status").val();

					var mpassword = $("#mpassword").text();
					var mpassworda = $("#mpassworda").text();
					var mphone = $("#mphone").text();
					var memail = $("#memail").text();



					
					
					
					$.ajax({
						url:'',

						type: 'post',

						data:{spassword:password,sphone:phone,semail:email ,spermission : permission,status : status , submit : 1},

						dataType:'json',

						success : function(msg){
							if(msg==1){
								$("#admin_ins").text('修改成功');
								return false;
							}else{
								$("#admin_ins").text('修改失败');
								return false;
							}
						}


					})
					return false;
					// alert(username);
				})
			</script>

			
			
			<!-- Start Notifications -->
			
			
			
			
			<!-- End Notifications -->
			
			